package com.corejsf;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;

@Named
@SessionScoped
/**
 * Holds all data for the user.
 * @author Jitin Dhillon, Kelton Kowalchuk
 *
 */
public class User {
	/**
	 * Full name of the user.
	 */
    private String fullname;
    /**
     * Username of the user.
     */
    private String username;
    /**
     * Password for the user.
     */
    private String password;
    /**
     * Employee number of the user.
     */
    private int eNumber;
    /**
     * boolean for if the user is the superuse.
     */
    private boolean superUser;
    /**
     * boolean for if the user data is editable in the
     * user modify screen of the superuser.
     */
    private boolean editable;
    /**
     * Holds the worksheet related to each week.
     */
    private Map<Integer , ArrayList<WorkSheet>> sheetMap = new HashMap<Integer , ArrayList<WorkSheet>>();
    /**
     * Constructor for user, inserts 5 blank rows for current week, and dummy data for a previous week.
     * @param f Full Name of user.
     * @param u Username of user.
     * @param p Password of user.
     * @param e Employee number of user.
     */
    public User(String f, String u, String p, int e) {
        fullname = f;
        username = u;
        password = p;
        eNumber = e;
    }
    
	public Map<Integer, ArrayList<WorkSheet>> getSheetMap() { return sheetMap; }
	public void setSheetMap(Map<Integer, ArrayList<WorkSheet>> sheetMap) { this.sheetMap = sheetMap; }

	public String getUsername() { return username; }
    public void setUsername(String username) { this.username = username; }
    
    public String getPassword() { return password; }
    public void setPassword(String password) { this.password = password; }    
    
    public boolean isSuperUser() { return superUser; }
    public void setSuperUser(boolean superUser) { this.superUser = superUser; }
   
    public int geteNumber() { return eNumber; }
    public void seteNumber(int eNumber) { this.eNumber = eNumber; }
    
    public String getFullname() { return fullname; }
    public void setFullname(String fullname) { this.fullname = fullname; }

	public boolean isEditable() { return editable; }
	public void setEditable(boolean editable) { this.editable = editable; }
}
